<!--专业技术资格-->
<blockquote class="layui-elem-quote" style="font-size: 14px">统计分析——星级积分规则
</blockquote>

<hr class="layui-bg-gray">

<form class="layui-form" action="" id="proTech_form">

    <table class="layui-table">
        <colgroup>

            <col width="200">
            <col width="200">
            <col width="200">
        </colgroup>
        <thead>
        <tr>
            <th>星级等级</th>
            <th>最小分 >= </th>
            <th>最大分 < </th>
        </tr>
        </thead>
        <tbody id="start_body">
        <tr>
            <td><input type="text" name="startTrainRules[0].grade" value="一星"  class="layui-input" readonly></td>
            <td><input type="text" name="startTrainRules[0].gradeCode" value="${startRules[0].gradeCode}"  class="layui-input" lay-verify="required|number"></td>
            <td><input type="text" name="startTrainRules[0].integral" value="${startRules[0].integral}" class="layui-input" lay-verify="required|number"></td>

        </tr>
        <tr>
            <td><input type="text" name="startTrainRules[1].grade" value="二星"  class="layui-input" readonly></td>
            <td><input type="text" name="startTrainRules[1].gradeCode" value="${startRules[1].gradeCode}"  class="layui-input" lay-verify="required|number"></td>
            <td><input type="text" name="startTrainRules[1].integral" value="${startRules[1].integral}" class="layui-input" lay-verify="required|number"></td>

        </tr>
        <tr>
            <td><input type="text" name="startTrainRules[2].grade" value="三星"  class="layui-input" readonly></td>
            <td><input type="text" name="startTrainRules[2].gradeCode" value="${startRules[2].gradeCode}"  class="layui-input" lay-verify="required|number"></td>
            <td><input type="text" name="startTrainRules[2].integral" value="${startRules[2].integral}" class="layui-input" lay-verify="required|number"></td>

        </tr>
        <tr>
            <td><input type="text" name="startTrainRules[3].grade" value="四星"  class="layui-input" readonly></td>
            <td><input type="text" name="startTrainRules[3].gradeCode" value="${startRules[3].gradeCode}"  class="layui-input" lay-verify="required|number"></td>
            <td><input type="text" name="startTrainRules[3].integral" value="${startRules[3].integral}" class="layui-input" lay-verify="required|number"></td>

        </tr>
        <tr>
            <td><input type="text" name="startTrainRules[4].grade" value="五星"  class="layui-input" readonly></td>
            <td><input type="text" name="startTrainRules[4].gradeCode" value="${startRules[4].gradeCode}"  class="layui-input" lay-verify="required|number"></td>
            <td><input type="text" name="startTrainRules[4].integral" value="${startRules[4].integral}" class="layui-input" lay-verify="required|number"></td>

        </tr>
        </tbody>
    </table>
    <div class="layui-form-item">
        <div class="layui-input-block" style="margin-top: 20px;">

            <button class="layui-btn" lay-submit lay-filter="start_form">提交保存</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>




<script>
    $(function(){
        initStartTrain();
    });
    /**
     * 添加行
     */
    function addProTechRow() {
        var trSize = $("#start_body>tr").length + 1;
        $("tbody").append($("template").html().replace(/\[]/g,"["+trSize+"]"));
    }

    /**
     * 删除行
     */
    function deleteProTechRow($this) {
        $this.closest("tr").empty();
    }

    /**
     * 提交
     */
    function initStartTrain() {
        layui.use(['form'], function(){
            var form = layui.form;

            form.on('submit(start_form)', function(data){
                form.verify();
                $.ajax({
                    type: "POST",
                    url: 'integral/train_start_add',
                    data: data.field,
                    dataType: "json",
                    success: function(data){
                        Feng.success("保存成功!");
                    }
                });
                return false;
            });
        });
    }

</script>